#!/bin/bash
pid=`ps ax | grep -i 'quota-backend' |grep java | grep -v grep | awk '{print $1}'`
if [ -z "$pid" ] ; then
    echo "未启动jvm."
else
    echo "The quota-backend(${pid}) is running..."
    kill ${pid}
fi
git pull origin master
mvn -X clean package -U -DskipTests
java -Xms256m -Xmx512m -XX:MaxMetaspaceSize=256m -jar -Dspring.profiles.active=proc target/quota-backend.jar >/dev/null 2>&1 &